<include file="Public:header" />
<include file="Public:left" />
	<form action="" method="post" enctype="multipart/form-data" id="brandForm">
     <section>
      <h2><strong>网站设置</strong></h2>
      <ul class="ulColumn2">
          <li>
              <span class="item_name" style="width:120px;">网站名称：</span>
              <input type="text" value="{$web_set_result['name']}" class="textbox textbox_295" name="name" id="name" placeholder="网站名称"/>
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站关键词：</span>
              <input type="text" value="{$web_set_result['keyword']}" class="textbox textbox_295" name="keyword" id="keyword" placeholder="网站关键词"/>
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站电话：</span>
              <input type="text" value="{$web_set_result['telephone']}" class="textbox textbox_295" name="telephone" id="telephone" placeholder="网站电话"/>
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站logo: </span>
              <input type="file" class="textbox textbox_295" name="logo" id="logo"/>
              <image src="__STATIC__/uploads/{$web_set_result['logo']}" width="80">
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站版权: </span>
              <input type="text" value="{$web_set_result['copy']}" class="textbox textbox_295" name="copy" id="copy"/>
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站二维码: </span>
              <input type="file" class="textbox textbox_295" name="qr" id="qr"/>
              <image src="__STATIC__/uploads/{$web_set_result['qr']}" width="80">
          </li>
          <li>
              <span class="item_name" style="width:120px;">首页banner: </span>
              <input type="file" class="textbox textbox_295" name="banner" id="banner"/>
              <image src="__STATIC__/uploads/{$web_set_result['banner']}" width="80">
          </li>
       <li>
        <span class="item_name" style="width:120px;"></span>
        <input type="button" class="link_btn" value="提交"/>
       </li>
      </ul>
     </section>
	 </form>
   <script>
      $(".link_btn").click(function(){
          var formData = new FormData();
          var name = $("input[name='name']").val();
          var keyword = $("input[name='keyword']").val();
          var telephone = $("input[name='telephone']").val();
          var copy = $("input[name='copy']").val();
          var file = $("input[name='logo']");
          var file2 = $("input[name='qr']");
          var file3 = $("input[name='banner']");
          var logo = file[0].files[0];
          var qr = file2[0].files[0];
          var banner = file3[0].files[0];

          formData.append('name',name);
          formData.append('keyword',keyword);
          formData.append('telephone',telephone);
          formData.append('copy',copy);
          formData.append('logo',logo);
          formData.append('qr',qr);
          formData.append('banner',banner);

          $.ajax({
                url:"{:url('Set/index')}",
                type:'POST',
                data:formData,
                async:false,
                processData:false,
                contentType:false,
                success:function(result){
                    if(result.code == '0'){
                        layer.alert(result.msg);
                    }else{
                        layer.alert(result.msg, {   
                            btn: ['确定']  
                        },  
                            function (index, item) { 
                            location.href = result.url;
                        });  
                    }
                }

            });
      });
   </script>
 </div>
</section>
</body>
</html>
